<?php

class Clientes_Model_DbTable_Clientes extends Zend_Db_Table_Abstract
{

    protected $_name = 'clientes';
    protected $_primary = 'id';
    protected $_referenceMap = array(
    		'Usuarios' => array(
    				'columns' => 'id_usuario',
    				'refTableClass' => 'Usuarios_Model_DbTable_Usuarios',
    				'refColumns' => 'id',
    				'onDelete' => self::RESTRICT,
    				'onUpdate' => self::RESTRICT
    		),
    		'Vendedores' => array(
    				'columns' => 'id_vendedor',
    				'refTableClass' => 'Usuarios_Model_DbTable_Usuarios',
    				'refColumns' => 'id',
    				'onDelete' => self::RESTRICT,
    				'onUpdate' => self::RESTRICT
    		));
    public function fillSelectClientes($order = 'nome') {
    	$sql = $this->select()->order($order);
    	return  $this->getAdapter()->fetchPairs($sql);
    
    }

}

